package com.li.controller;

import com.li.service.RedisLock01Service;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@Api(tags="redis分布式锁")//swagger2
@Tag(name = "redis分布式锁测试")
public class RedisLock01Controller {
    @Autowired
    private RedisLock01Service redisLock01Service;
    //inventory 库存
//    @ApiOperation("减库存 , 一次卖一个")//swagger2
    @Operation(description="减库存 , 一次卖一个")
    @GetMapping(value = "/inventory/sale")
    public String sale(){
        return redisLock01Service.sale();
    }
}
